package com.wiseman.writing.utility.parsedata;

import java.io.InputStream;
import java.util.Map;
import java.util.TreeMap;

public class Pinyin2Char extends TxtParser{	
	
	public Map<String, String> mPY2CharTab = new TreeMap<String, String>();

	public Pinyin2Char(String filename) {
		read(filename);
	}
	
	public Pinyin2Char(InputStream in) {		
		read(in);
	}

	@Override
	void processLine(String line) {	
	
		int startIndex = line.indexOf("[");
		int endIndex = line.indexOf("]");
		
		String pinyin = line.substring(0, startIndex);
		String chars  = line.substring(startIndex+1, endIndex);
		mPY2CharTab.put(pinyin, chars);		
	}

}
